package com.springel;

import org.junit.Test;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;

public class LiteralExprSample {

    @Test
    public void test(){
        ExpressionParser expressionParser = new SpelExpressionParser();

        //解析字符串
        String hello = expressionParser.parseExpression("\"hello world\"").getValue(String.class);

        //解析双精度浮点型
        double doubleNumber = expressionParser.parseExpression("6.022144444E+23").getValue(Double.class);

        System.out.println("hello:" + hello + ",double:" + doubleNumber);

    }
}
